import React, { useState } from 'react';
import {getAuthority} from '@/utils/authority';
const Access = (props) => {
  const authorities = getAuthority();
  const {accessKey} = props;
  return (
      (authorities && authorities.indexOf(accessKey) !== -1)
      ?
        <>
          {props.children}
        </>
      :
        null
  );
};

export default Access;
